package com.spring.annotationDI;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @ClassName: Student
 **/
@Repository
@Primary
public class StudentDao {

    @PostConstruct
    public void init(){
        System.out.println("初始化方法xx");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("销毁方法xx");
    }

    /***
     * @Description //用于保存方法
     **/
    public int save(){
        System.out.println("基于注解的保存方法。。。。！");
        return 1;
    }
}
